<template>
	<div class="leftall">
		<div class="logo"><img src="../../static/img/wulianwanglogo.png" @click="shouqilai"></div>
		<div class="title">联通物联网系统</div>
		<div class="nav">
			<router-link class="navli" v-if="userIdentity == 3" :to="{path:'/index'}">代理商管理</router-link>
			<router-link class="navli" v-if="userIdentity == 3" :to="{path:'/taocan'}">套餐管理</router-link>
			<router-link class="navli" v-if="userIdentity == 3 || userIdentity == 2" :to="{path:'/ka'}">卡管理</router-link>
			<router-link class="navli" v-if="userIdentity == 3" :to="{path:'/huodong'}">活动管理</router-link>
			<router-link class="navli" v-if="userIdentity == 3 || userIdentity == 2" :to="{path:'/yonghu'}">用户账号管理</router-link>
			<router-link class="navli" v-if="userIdentity == 3 || userIdentity == 4" :to="{path:'/dailishangbaobiao'}">代理商报表</router-link>
			<router-link class="navli" v-if="userIdentity == 3" :to="{path:'/caiwubaobiao'}">财务管理</router-link>
		</div>
	</div>
</template>

<script>
	import axios from 'axios'
	export default {
		name: 'left',
		data() {
			return {
				userIdentity: 0
			}
		},
		watch: {
			// num:function(newValue, oldValue) {
			//   console.log(newValue, oldValue)
			// }
		},
		computed: {
			// zongjia:function(){
			//   return this.num * 100
			// }
		},
		created() {
			this.userIdentity = JSON.parse(localStorage.getItem('person')).userIdentity
		},
		methods: {
			shouqilai:function(){
				this.$emit('shouqilai')
			}
		},

	}
</script>

<style scoped lang="less">
	.leftall {
		.logo {
			padding: 30px 0;
			text-align: center;

			img {
				width: 100px;
			}
		}

		.title {
			color: #FFFFFF;
			text-align: center;
			font-weight: bold;
			font-size: 28px;
			text-shadow: 2px 2px 5px #000;
		}

		.nav {
			padding-top: 50px;

			.navli {
				display: block;
				text-align: center;
				color: #FFFFFF;
				line-height: 50px;
				font-size: 18px;
				text-shadow: 2px 2px 2px #000;
				font-weight: bold;

				&:hover {
					background: rgba(0, 0, 0, 0.5);
					color: #FFB300;
					transition: all 0.3s;
				}
			}

			.router-link-exact-active,
			.router-link-active {
				background: rgba(0, 0, 0, 0.5);
				color: #FFB300;
			}
		}

	}
</style>
